package com.lejin.item.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lejin.item.entity.CourseOutline;
import com.lejin.item.mapper.CourseOutlineMapper;
import com.lejin.item.service.ICourseOutlineService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author luminghua
 * @since 2022-04-20
 */
@Service
public class CourseOutlineServiceImpl extends ServiceImpl<CourseOutlineMapper, CourseOutline> implements ICourseOutlineService {

    @Autowired
    CourseOutlineMapper courseOutlineMapper;
    @Override
    public List<CourseOutline> sendCourseOutlineByCategory2Id(Integer c2Id) {

        QueryWrapper<CourseOutline> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("category2_id",c2Id);
        return courseOutlineMapper.selectList(queryWrapper);
    }

    @Override
    public CourseOutline findCourseOutlineById(Integer id) {

        CourseOutline courseOutline = courseOutlineMapper.selectById(id);
        return courseOutline;
    }
}
